home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1995-04-15 | 6.9 KB | [TEXT/MMCC] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Sat Apr 15 18:19:21 1995, modified Sat Apr 15 18:19:21 1995, creator 'MMCC', type ASCII, 6379 bytes "AEThreads.c" , at 0x196b 410 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [MMCC] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0b 41 45 54 68 72 65 | 61 64 73 2e 63 00 00 00 |..AEThre|ads.c...|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 4d 43 | 43 01 00 00 00 00 00 00 |.TEXTMMC|C.......|
|00000050| 00 00 00 00 00 18 eb 00 | 00 01 9a ab b5 f6 e9 ab |........|........|
|00000060| b5 f6 e9 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 7e 46 00 00 |........|....~F..|
|00000080| 2f 2f 09 41 45 54 68 72 | 65 61 64 73 2e 68 0d 2f |//.AEThr|eads.h./|
|00000090| 2f 0d 2f 2f 09 43 6f 70 | 79 72 69 67 68 74 20 a9 |/.//.Cop|yright .|
|000000a0| 20 31 39 39 33 2d 39 35 | 20 53 74 65 76 65 20 53 | 1993-95| Steve S|
|000000b0| 69 73 61 6b 0d 2f 2f 09 | 0d 2f 2f 09 4c 69 63 65 |isak.//.|.//.Lice|
|000000c0| 6e 73 65 20 69 73 20 67 | 72 61 6e 74 65 64 20 74 |nse is g|ranted t|
|000000d0| 6f 20 75 73 65 2c 20 6d | 6f 64 69 66 79 2c 20 6d |o use, m|odify, m|
|000000e0| 61 6b 65 20 64 65 72 69 | 76 61 74 69 76 65 20 77 |ake deri|vative w|
|000000f0| 6f 72 6b 73 2c 20 61 6e | 64 20 0d 2f 2f 09 64 75 |orks, an|d .//.du|
|00000100| 70 6c 69 63 61 74 65 20 | 74 68 69 73 20 63 6f 64 |plicate |this cod|
|00000110| 65 20 61 74 20 77 69 6c | 6c 2c 20 73 6f 20 6c 6f |e at wil|l, so lo|
|00000120| 6e 67 20 61 73 20 74 68 | 69 73 20 6e 6f 74 69 63 |ng as th|is notic|
|00000130| 65 20 72 65 6d 61 69 6e | 73 20 69 6e 74 61 63 74 |e remain|s intact|
|00000140| 2e 0d 2f 2f 0d 0d 23 69 | 66 6e 64 65 66 20 5f 5f |..//..#i|fndef __|
|00000150| 41 45 54 48 52 45 41 44 | 53 5f 5f 0d 23 69 6e 63 |AETHREAD|S__.#inc|
|00000160| 6c 75 64 65 20 22 41 45 | 54 68 72 65 61 64 73 2e |lude "AE|Threads.|
|00000170| 68 22 0d 23 65 6e 64 69 | 66 0d 23 69 66 6e 64 65 |h".#endi|f.#ifnde|
|00000180| 66 20 5f 5f 45 52 52 4f | 52 53 5f 5f 0d 23 69 6e |f __ERRO|RS__.#in|
|00000190| 63 6c 75 64 65 20 3c 45 | 72 72 6f 72 73 2e 68 3e |clude <E|rrors.h>|
|000001a0| 0d 23 65 6e 64 69 66 0d | 23 69 66 6e 64 65 66 20 |.#endif.|#ifndef |
|000001b0| 5f 5f 41 50 50 4c 45 45 | 56 45 4e 54 53 5f 5f 0d |__APPLEE|VENTS__.|
|000001c0| 23 69 6e 63 6c 75 64 65 | 20 3c 41 70 70 6c 65 45 |#include| <AppleE|
|000001d0| 76 65 6e 74 73 2e 68 3e | 0d 23 65 6e 64 69 66 0d |vents.h>|.#endif.|
|000001e0| 23 69 66 20 5f 5f 4d 57 | 45 52 4b 53 5f 5f 0d 23 |#if __MW|ERKS__.#|
|000001f0| 69 66 20 64 65 66 69 6e | 65 64 28 70 6f 77 65 72 |if defin|ed(power|
|00000200| 63 29 20 7c 7c 20 64 65 | 66 69 6e 65 64 28 5f 5f |c) || de|fined(__|
|00000210| 70 6f 77 65 72 63 29 0d | 23 69 6e 63 6c 75 64 65 |powerc).|#include|
|00000220| 20 3c 43 50 6c 75 73 4c | 69 62 50 50 43 2e 68 3e | <CPlusL|ibPPC.h>|
|00000230| 0d 23 65 6c 73 65 0d 23 | 69 6e 63 6c 75 64 65 20 |.#else.#|include |
|00000240| 3c 73 74 64 6c 69 62 2e | 68 3e 0d 23 69 6e 63 6c |<stdlib.|h>.#incl|
|00000250| 75 64 65 20 3c 43 50 6c | 75 73 4c 69 62 36 38 6b |ude <CPl|usLib68k|
|00000260| 2e 68 3e 0d 23 65 6e 64 | 69 66 0d 23 65 6e 64 69 |.h>.#end|if.#endi|
|00000270| 66 0d 0d 74 79 70 65 64 | 65 66 20 73 74 72 75 63 |f..typed|ef struc|
|00000280| 74 20 41 45 54 68 72 65 | 61 64 44 65 73 63 20 20 |t AEThre|adDesc |
|00000290| 41 45 54 68 72 65 61 64 | 44 65 73 63 3b 0d 74 79 |AEThread|Desc;.ty|
|000002a0| 70 65 64 65 66 20 73 74 | 72 75 63 74 20 41 45 54 |pedef st|ruct AET|
|000002b0| 68 72 65 61 64 50 61 72 | 61 6d 20 41 45 54 68 72 |hreadPar|am AEThr|
|000002c0| 65 61 64 50 61 72 61 6d | 3b 0d 74 79 70 65 64 65 |eadParam|;.typede|
|000002d0| 66 20 73 74 72 75 63 74 | 20 41 45 53 77 61 70 44 |f struct| AESwapD|
|000002e0| 61 74 61 20 20 20 20 41 | 45 53 77 61 70 44 61 74 |ata A|ESwapDat|
|000002f0| 61 3b 0d 0d 2f 2f 20 41 | 20 70 6f 69 6e 74 65 72 |a;..// A| pointer|
|00000300| 20 74 6f 20 74 68 69 73 | 20 73 74 72 75 63 74 75 | to this| structu|
|00000310| 72 65 20 69 73 20 6b 65 | 70 74 20 69 6e 20 74 68 |re is ke|pt in th|
|00000320| 65 20 72 65 66 63 6f 6e | 20 73 74 6f 72 65 64 20 |e refcon| stored |
|00000330| 62 79 0d 2f 2f 20 41 45 | 49 6e 73 74 61 6c 6c 45 |by.// AE|InstallE|
|00000340| 76 65 6e 74 48 61 6e 64 | 6c 65 72 28 29 2e 20 20 |ventHand|ler(). |
|00000350| 53 69 6e 63 65 20 74 68 | 65 79 20 61 72 65 20 74 |Since th|ey are t|
|00000360| 79 70 69 63 61 6c 6c 79 | 20 6f 6e 6c 79 20 63 72 |ypically| only cr|
|00000370| 65 61 74 65 64 20 61 74 | 0d 2f 2f 20 61 70 70 6c |eated at|.// appl|
|00000380| 69 63 61 74 69 6f 6e 20 | 73 74 61 72 74 75 70 20 |ication |startup |
|00000390| 74 69 6d 65 2c 20 75 73 | 69 6e 67 20 61 20 70 6f |time, us|ing a po|
|000003a0| 69 6e 74 65 72 20 77 69 | 6c 6c 20 6e 6f 74 20 66 |inter wi|ll not f|
|000003b0| 72 61 67 6d 65 6e 74 20 | 74 68 65 20 0d 2f 2f 20 |ragment |the .// |
|000003c0| 61 70 70 6c 69 63 61 74 | 69 6f 6e 20 68 65 61 70 |applicat|ion heap|
|000003d0| 2e 0d 0d 73 74 72 75 63 | 74 20 41 45 54 68 72 65 |...struc|t AEThre|
|000003e0| 61 64 44 65 73 63 09 09 | 09 09 09 2f 2f 20 4b 65 |adDesc..|...// Ke|
|000003f0| 70 74 20 69 6e 20 74 68 | 65 20 4f 53 20 72 65 66 |pt in th|e OS ref|
|00000400| 63 6f 6e 0d 7b 0d 09 41 | 45 45 76 65 6e 74 48 61 |con.{..A|EEventHa|
|00000410| 6e 64 6c 65 72 55 50 50 | 09 68 61 6e 64 6c 65 72 |ndlerUPP|.handler|
|00000420| 3b 09 2f 2f 20 54 68 65 | 20 72 65 61 6c 20 68 61 |;.// The| real ha|
|00000430| 6e 64 6c 65 72 0d 09 6c | 6f 6e 67 09 09 09 09 72 |ndler..l|ong....r|
|00000440| 65 66 63 6f 6e 3b 09 09 | 2f 2f 20 54 68 65 20 72 |efcon;..|// The r|
|00000450| 65 61 6c 20 72 65 66 63 | 6f 6e 0d 09 53 69 7a 65 |eal refc|on..Size|
|00000460| 09 09 09 09 73 74 61 63 | 6b 53 69 7a 65 3b 09 2f |....stac|kSize;./|
|00000470| 2f 20 53 74 61 63 6b 20 | 73 69 7a 65 20 66 6f 72 |/ Stack |size for|
|00000480| 20 68 61 6e 64 6c 69 6e | 67 20 65 76 65 6e 74 0d | handlin|g event.|
|00000490| 09 54 68 72 65 61 64 4f | 70 74 69 6f 6e 73 09 09 |.ThreadO|ptions..|
|000004a0| 6f 70 74 69 6f 6e 73 3b | 09 2f 2f 20 54 68 72 65 |options;|.// Thre|
|000004b0| 61 64 20 6f 70 74 69 6f | 6e 73 20 66 6f 72 20 65 |ad optio|ns for e|
|000004c0| 76 65 6e 74 0d 09 54 68 | 72 65 61 64 49 44 09 09 |vent..Th|readID..|
|000004d0| 09 68 6f 6c 64 65 72 3b | 09 09 2f 2f 20 75 73 65 |.holder;|..// use|
|000004e0| 64 20 61 73 20 61 20 73 | 65 6d 61 70 68 6f 72 65 |d as a s|emaphore|
|000004f0| 0d 7d 3b 0d 0d 2f 2f 20 | 54 68 69 73 20 73 74 72 |.};..// |This str|
|00000500| 75 63 74 75 72 65 20 69 | 73 20 75 73 65 64 20 74 |ucture i|s used t|
|00000510| 6f 20 70 61 73 73 20 70 | 61 72 61 6d 65 74 65 72 |o pass p|arameter|
|00000520| 73 20 74 6f 20 61 20 6e | 65 77 20 74 68 72 65 61 |s to a n|ew threa|
|00000530| 64 20 64 75 72 69 6e 67 | 20 74 68 65 0d 2f 2f 20 |d during| the.// |
|00000540| 73 70 61 77 6e 69 6e 67 | 20 70 72 6f 63 65 73 73 |spawning| process|
|00000550| 2e 20 20 4e 6f 74 65 20 | 74 68 61 74 20 69 74 20 |. Note |that it |
|00000560| 69 73 20 70 61 73 73 65 | 64 20 6f 6e 20 74 68 65 |is passe|d on the|
|00000570| 20 73 74 61 63 6b 20 61 | 6e 64 20 6d 75 73 74 20 | stack a|nd must |
|00000580| 62 65 20 0d 2f 2f 20 6b | 65 70 74 20 76 61 6c 69 |be .// k|ept vali|
|00000590| 64 20 75 6e 74 69 6c 20 | 74 68 65 20 74 68 72 65 |d until |the thre|
|000005a0| 61 64 20 68 61 73 20 72 | 75 6e 20 6f 6e 63 65 2e |ad has r|un once.|
|000005b0| 0d 0d 73 74 72 75 63 74 | 20 41 45 54 68 72 65 61 |..struct| AEThrea|
|000005c0| 64 50 61 72 61 6d 09 09 | 09 09 2f 2f 20 55 73 65 |dParam..|..// Use|
|000005d0| 64 20 69 6e 20 73 70 61 | 77 6e 69 6e 67 0d 7b 0d |d in spa|wning.{.|
|000005e0| 09 63 6f 6e 73 74 20 41 | 70 70 6c 65 45 76 65 6e |.const A|ppleEven|
|000005f0| 74 2a 09 65 76 65 6e 74 | 3b 0d 09 41 70 70 6c 65 |t*.event|;..Apple|
|00000600| 45 76 65 6e 74 2a 09 09 | 09 72 65 70 6c 79 3b 0d |Event*..|.reply;.|
|00000610| 09 41 45 54 68 72 65 61 | 64 44 65 73 63 2a 09 09 |.AEThrea|dDesc*..|
|00000620| 64 65 73 63 3b 0d 09 54 | 68 72 65 61 64 49 44 09 |desc;..T|hreadID.|
|00000630| 09 09 74 68 72 65 61 64 | 3b 0d 09 4f 53 45 72 72 |..thread|;..OSErr|
|00000640| 09 09 09 09 72 65 73 75 | 6c 74 3b 0d 7d 3b 0d 0d |....resu|lt;.};..|
|00000650| 2f 2f 20 54 68 69 73 20 | 73 74 72 75 63 74 75 72 |// This |structur|
|00000660| 65 20 69 73 20 75 73 65 | 64 20 74 6f 20 73 74 6f |e is use|d to sto|
|00000670| 72 65 20 61 6e 79 20 74 | 68 72 65 61 64 20 63 6f |re any t|hread co|
|00000680| 6e 74 65 78 74 20 77 68 | 69 63 68 20 6d 75 73 74 |ntext wh|ich must|
|00000690| 20 62 65 0d 2f 2f 20 73 | 61 76 65 64 20 73 6e 64 | be.// s|aved snd|
|000006a0| 20 72 65 73 74 6f 72 65 | 64 20 61 73 20 74 68 65 | restore|d as the|
|000006b0| 20 74 68 72 65 61 64 20 | 69 73 20 73 77 61 70 70 | thread |is swapp|
|000006c0| 65 64 20 69 6e 20 61 6e | 64 20 6f 75 74 2e 20 59 |ed in an|d out. Y|
|000006d0| 6f 75 20 6d 61 79 20 0d | 2f 2f 20 77 61 6e 74 20 |ou may .|// want |
|000006e0| 74 6f 20 6d 6f 64 69 66 | 79 20 74 68 69 73 20 73 |to modif|y this s|
|000006f0| 74 72 75 63 74 75 72 65 | 20 61 6e 64 20 41 45 53 |tructure| and AES|
|00000700| 77 69 74 63 68 49 6e 48 | 61 6e 64 6c 65 72 28 29 |witchInH|andler()|
|00000710| 20 61 6e 64 0d 2f 2f 20 | 41 45 53 77 69 74 63 68 | and.// |AESwitch|
|00000720| 4f 75 74 48 61 6e 64 6c | 65 72 28 29 20 74 6f 20 |OutHandl|er() to |
|00000730| 73 61 76 65 20 6d 6f 72 | 65 20 63 6f 6e 74 65 78 |save mor|e contex|
|00000740| 74 2e 20 49 6e 20 74 68 | 65 20 66 75 74 75 72 65 |t. In th|e future|
|00000750| 2c 20 74 68 69 73 0d 2f | 2f 20 73 68 6f 75 6c 64 |, this./|/ should|
|00000760| 20 72 65 61 6c 6c 79 20 | 62 65 20 61 20 43 2b 2b | really |be a C++|
|00000770| 20 63 6c 61 73 73 0d 0d | 73 74 72 75 63 74 20 41 | class..|struct A|
|00000780| 45 53 77 61 70 44 61 74 | 61 0d 7b 0d 09 76 6f 69 |ESwapDat|a.{..voi|
|00000790| 64 2a 09 09 09 09 66 54 | 6f 70 48 61 6e 64 6c 65 |d*....fT|opHandle|
|000007a0| 72 3b 09 2f 2f 20 54 6f | 70 20 66 61 69 6c 75 72 |r;.// To|p failur|
|000007b0| 65 20 68 61 6e 64 6c 65 | 72 0d 0d 23 69 66 64 65 |e handle|r..#ifde|
|000007c0| 66 20 5f 5f 4d 57 45 52 | 4b 53 5f 5f 0d 09 44 65 |f __MWER|KS__..De|
|000007d0| 73 74 72 75 63 74 6f 72 | 43 68 61 69 6e 2a 09 66 |structor|Chain*.f|
|000007e0| 53 74 61 74 69 63 43 68 | 61 69 6e 3b 09 2f 2f 0d |StaticCh|ain;.//.|
|000007f0| 23 65 6e 64 69 66 0d 7d | 3b 0d 0d 70 61 73 63 61 |#endif.}|;..pasca|
|00000800| 6c 20 76 6f 69 64 09 09 | 41 45 53 77 69 74 63 68 |l void..|AESwitch|
|00000810| 49 6e 48 61 6e 64 6c 65 | 72 28 54 68 72 65 61 64 |InHandle|r(Thread|
|00000820| 49 44 20 74 68 72 65 61 | 64 42 65 69 6e 67 53 77 |ID threa|dBeingSw|
|00000830| 69 74 63 68 65 64 2c 20 | 76 6f 69 64 20 2a 73 77 |itched, |void *sw|
|00000840| 69 74 63 68 50 72 6f 63 | 50 61 72 61 6d 29 3b 0d |itchProc|Param);.|
|00000850| 70 61 73 63 61 6c 20 76 | 6f 69 64 09 09 41 45 53 |pascal v|oid..AES|
|00000860| 77 69 74 63 68 4f 75 74 | 48 61 6e 64 6c 65 72 28 |witchOut|Handler(|
|00000870| 54 68 72 65 61 64 49 44 | 20 74 68 72 65 61 64 42 |ThreadID| threadB|
|00000880| 65 69 6e 67 53 77 69 74 | 63 68 65 64 2c 20 76 6f |eingSwit|ched, vo|
|00000890| 69 64 20 2a 73 77 69 74 | 63 68 50 72 6f 63 50 61 |id *swit|chProcPa|
|000008a0| 72 61 6d 29 3b 0d 70 61 | 73 63 61 6c 20 4f 53 45 |ram);.pa|scal OSE|
|000008b0| 72 72 09 41 45 53 70 61 | 77 6e 41 45 54 68 72 65 |rr.AESpa|wnAEThre|
|000008c0| 61 64 28 63 6f 6e 73 74 | 20 41 70 70 6c 65 45 76 |ad(const| AppleEv|
|000008d0| 65 6e 74 20 2a 74 68 65 | 41 70 70 6c 65 45 76 65 |ent *the|AppleEve|
|000008e0| 6e 74 2c 20 41 70 70 6c | 65 45 76 65 6e 74 20 2a |nt, Appl|eEvent *|
|000008f0| 72 65 70 6c 79 2c 20 6c | 6f 6e 67 20 68 61 6e 64 |reply, l|ong hand|
|00000900| 6c 65 72 52 65 66 63 6f | 6e 29 3b 0d 70 61 73 63 |lerRefco|n);.pasc|
|00000910| 61 6c 20 6c 6f 6e 67 09 | 09 41 45 54 68 72 65 61 |al long.|.AEThrea|
|00000920| 64 28 41 45 54 68 72 65 | 61 64 50 61 72 61 6d 2a |d(AEThre|adParam*|
|00000930| 20 70 61 72 6d 73 29 3b | 0d 0d 41 45 45 76 65 6e | parms);|..AEEven|
|00000940| 74 48 61 6e 64 6c 65 72 | 55 50 50 20 67 53 70 61 |tHandler|UPP gSpa|
|00000950| 77 6e 41 45 54 68 72 65 | 61 64 55 50 50 20 3d 20 |wnAEThre|adUPP = |
|00000960| 6e 69 6c 3b 0d 0d 23 70 | 72 61 67 6d 61 20 73 65 |nil;..#p|ragma se|
|00000970| 67 6d 65 6e 74 20 66 6f | 6f 62 61 72 0d 0d 70 61 |gment fo|obar..pa|
|00000980| 73 63 61 6c 20 4f 53 45 | 72 72 20 41 45 49 6e 73 |scal OSE|rr AEIns|
|00000990| 74 61 6c 6c 54 68 72 65 | 61 64 65 64 45 76 65 6e |tallThre|adedEven|
|000009a0| 74 48 61 6e 64 6c 65 72 | 28 0d 09 41 45 45 76 65 |tHandler|(..AEEve|
|000009b0| 6e 74 43 6c 61 73 73 09 | 09 74 68 65 41 45 45 76 |ntClass.|.theAEEv|
|000009c0| 65 6e 74 43 6c 61 73 73 | 2c 0d 09 41 45 45 76 65 |entClass|,..AEEve|
|000009d0| 6e 74 49 44 09 09 09 74 | 68 65 41 45 45 76 65 6e |ntID...t|heAEEven|
|000009e0| 74 49 44 2c 0d 09 41 45 | 45 76 65 6e 74 48 61 6e |tID,..AE|EventHan|
|000009f0| 64 6c 65 72 55 50 50 09 | 70 72 6f 63 2c 0d 09 6c |dlerUPP.|proc,..l|
|00000a00| 6f 6e 67 09 09 09 09 68 | 61 6e 64 6c 65 72 52 65 |ong....h|andlerRe|
|00000a10| 66 63 6f 6e 2c 0d 09 54 | 68 72 65 61 64 4f 70 74 |fcon,..T|hreadOpt|
|00000a20| 69 6f 6e 73 09 09 6f 70 | 74 69 6f 6e 73 2c 0d 09 |ions..op|tions,..|
|00000a30| 53 69 7a 65 09 09 09 09 | 73 74 61 63 6b 73 69 7a |Size....|stacksiz|
|00000a40| 65 29 0d 7b 0d 09 41 45 | 54 68 72 65 61 64 44 65 |e).{..AE|ThreadDe|
|00000a50| 73 63 2a 20 64 65 73 63 | 20 3d 20 28 41 45 54 68 |sc* desc| = (AETh|
|00000a60| 72 65 61 64 44 65 73 63 | 2a 29 20 4e 65 77 50 74 |readDesc|*) NewPt|
|00000a70| 72 28 73 69 7a 65 6f 66 | 28 41 45 54 68 72 65 61 |r(sizeof|(AEThrea|
|00000a80| 64 44 65 73 63 29 29 3b | 0d 09 4f 53 45 72 72 09 |dDesc));|..OSErr.|
|00000a90| 09 20 20 65 72 72 20 20 | 3d 20 4d 65 6d 45 72 72 |. err |= MemErr|
|00000aa0| 6f 72 28 29 3b 0d 09 0d | 09 69 66 20 28 67 53 70 |or();...|.if (gSp|
|00000ab0| 61 77 6e 41 45 54 68 72 | 65 61 64 55 50 50 20 3d |awnAEThr|eadUPP =|
|00000ac0| 3d 20 6e 69 6c 29 0d 09 | 7b 0d 09 09 67 53 70 61 |= nil)..|{...gSpa|
|00000ad0| 77 6e 41 45 54 68 72 65 | 61 64 55 50 50 20 3d 20 |wnAEThre|adUPP = |
|00000ae0| 4e 65 77 41 45 45 76 65 | 6e 74 48 61 6e 64 6c 65 |NewAEEve|ntHandle|
|00000af0| 72 50 72 6f 63 28 41 45 | 53 70 61 77 6e 41 45 54 |rProc(AE|SpawnAET|
|00000b00| 68 72 65 61 64 29 3b 0d | 09 7d 0d 09 0d 09 69 66 |hread);.|.}....if|
|00000b10| 20 28 65 72 72 20 3d 3d | 20 6e 6f 45 72 72 29 0d | (err ==| noErr).|
|00000b20| 09 7b 0d 09 09 64 65 73 | 63 2d 3e 68 61 6e 64 6c |.{...des|c->handl|
|00000b30| 65 72 09 3d 20 70 72 6f | 63 3b 0d 09 09 64 65 73 |er.= pro|c;...des|
|00000b40| 63 2d 3e 72 65 66 63 6f | 6e 09 3d 20 68 61 6e 64 |c->refco|n.= hand|
|00000b50| 6c 65 72 52 65 66 63 6f | 6e 3b 0d 09 09 64 65 73 |lerRefco|n;...des|
|00000b60| 63 2d 3e 73 74 61 63 6b | 53 69 7a 65 09 3d 20 73 |c->stack|Size.= s|
|00000b70| 74 61 63 6b 73 69 7a 65 | 3b 0d 09 09 64 65 73 63 |tacksize|;...desc|
|00000b80| 2d 3e 6f 70 74 69 6f 6e | 73 09 3d 20 6f 70 74 69 |->option|s.= opti|
|00000b90| 6f 6e 73 3b 0d 09 09 64 | 65 73 63 2d 3e 68 6f 6c |ons;...d|esc->hol|
|00000ba0| 64 65 72 09 3d 20 6b 4e | 6f 54 68 72 65 61 64 49 |der.= kN|oThreadI|
|00000bb0| 44 3b 0d 0d 09 09 65 72 | 72 20 3d 20 41 45 49 6e |D;....er|r = AEIn|
|00000bc0| 73 74 61 6c 6c 45 76 65 | 6e 74 48 61 6e 64 6c 65 |stallEve|ntHandle|
|00000bd0| 72 28 74 68 65 41 45 45 | 76 65 6e 74 43 6c 61 73 |r(theAEE|ventClas|
|00000be0| 73 2c 20 74 68 65 41 45 | 45 76 65 6e 74 49 44 2c |s, theAE|EventID,|
|00000bf0| 20 67 53 70 61 77 6e 41 | 45 54 68 72 65 61 64 55 | gSpawnA|EThreadU|
|00000c00| 50 50 2c 20 28 6c 6f 6e | 67 29 20 64 65 73 63 2c |PP, (lon|g) desc,|
|00000c10| 20 66 61 6c 73 65 29 3b | 0d 09 7d 0d 09 0d 09 72 | false);|..}....r|
|00000c20| 65 74 75 72 6e 20 65 72 | 72 3b 0d 7d 0d 0d 23 70 |eturn er|r;.}..#p|
|00000c30| 72 61 67 6d 61 20 73 65 | 67 6d 65 6e 74 20 41 45 |ragma se|gment AE|
|00000c40| 54 68 72 65 61 64 0d 0d | 70 61 73 63 61 6c 20 76 |Thread..|pascal v|
|00000c50| 6f 69 64 20 41 45 53 77 | 69 74 63 68 49 6e 48 61 |oid AESw|itchInHa|
|00000c60| 6e 64 6c 65 72 28 54 68 | 72 65 61 64 49 44 20 74 |ndler(Th|readID t|
|00000c70| 68 72 65 61 64 42 65 69 | 6e 67 53 77 69 74 63 68 |hreadBei|ngSwitch|
|00000c80| 65 64 2c 20 76 6f 69 64 | 20 2a 73 77 69 74 63 68 |ed, void| *switch|
|00000c90| 50 72 6f 63 50 61 72 61 | 6d 29 0d 7b 0d 09 41 45 |ProcPara|m).{..AE|
|00000ca0| 53 77 61 70 44 61 74 61 | 2a 20 73 77 61 70 20 3d |SwapData|* swap =|
|00000cb0| 20 28 41 45 53 77 61 70 | 44 61 74 61 2a 29 20 73 | (AESwap|Data*) s|
|00000cc0| 77 69 74 63 68 50 72 6f | 63 50 61 72 61 6d 3b 0d |witchPro|cParam;.|
|00000cd0| 0d 23 69 66 64 65 66 20 | 5f 5f 4d 57 45 52 4b 53 |.#ifdef |__MWERKS|
|00000ce0| 5f 5f 0d 09 73 77 61 70 | 2d 3e 66 53 74 61 74 69 |__..swap|->fStati|
|00000cf0| 63 43 68 61 69 6e 20 3d | 20 5f 5f 6c 6f 63 61 6c |cChain =| __local|
|00000d00| 5f 64 65 73 74 72 75 63 | 74 6f 72 5f 63 68 61 69 |_destruc|tor_chai|
|00000d10| 6e 3b 0d 23 65 6e 64 69 | 66 0d 0d 09 2f 2f 20 53 |n;.#endi|f...// S|
|00000d20| 77 61 70 20 69 6e 20 61 | 6e 79 20 61 64 64 69 74 |wap in a|ny addit|
|00000d30| 69 6f 6e 61 6c 20 63 6f | 6e 74 65 78 74 20 68 65 |ional co|ntext he|
|00000d40| 72 65 0d 0d 7d 0d 0d 70 | 61 73 63 61 6c 20 76 6f |re..}..p|ascal vo|
|00000d50| 69 64 20 41 45 53 77 69 | 74 63 68 4f 75 74 48 61 |id AESwi|tchOutHa|
|00000d60| 6e 64 6c 65 72 28 54 68 | 72 65 61 64 49 44 20 74 |ndler(Th|readID t|
|00000d70| 68 72 65 61 64 42 65 69 | 6e 67 53 77 69 74 63 68 |hreadBei|ngSwitch|
|00000d80| 65 64 2c 20 76 6f 69 64 | 20 2a 73 77 69 74 63 68 |ed, void| *switch|
|00000d90| 50 72 6f 63 50 61 72 61 | 6d 29 0d 7b 0d 09 41 45 |ProcPara|m).{..AE|
|00000da0| 53 77 61 70 44 61 74 61 | 2a 20 73 77 61 70 20 3d |SwapData|* swap =|
|00000db0| 20 28 41 45 53 77 61 70 | 44 61 74 61 2a 29 20 73 | (AESwap|Data*) s|
|00000dc0| 77 69 74 63 68 50 72 6f | 63 50 61 72 61 6d 3b 0d |witchPro|cParam;.|
|00000dd0| 0d 09 2f 2f 20 53 77 61 | 70 20 6f 75 74 20 61 6e |..// Swa|p out an|
|00000de0| 79 20 61 64 64 69 74 69 | 6f 6e 61 6c 20 63 6f 6e |y additi|onal con|
|00000df0| 74 65 78 74 20 68 65 72 | 65 0d 0d 23 69 66 64 65 |text her|e..#ifde|
|00000e00| 66 20 5f 5f 4d 57 45 52 | 4b 53 5f 5f 0d 09 5f 5f |f __MWER|KS__..__|
|00000e10| 6c 6f 63 61 6c 5f 64 65 | 73 74 72 75 63 74 6f 72 |local_de|structor|
|00000e20| 5f 63 68 61 69 6e 20 3d | 20 73 77 61 70 2d 3e 66 |_chain =| swap->f|
|00000e30| 53 74 61 74 69 63 43 68 | 61 69 6e 3b 0d 23 65 6e |StaticCh|ain;.#en|
|00000e40| 64 69 66 0d 7d 0d 0d 0d | 23 64 65 66 69 6e 65 20 |dif.}...|#define |
|00000e50| 45 72 72 43 68 65 63 6b | 28 6c 61 62 65 6c 2c 20 |ErrCheck|(label, |
|00000e60| 72 65 73 75 6c 74 29 20 | 20 69 66 20 28 28 72 65 |result) | if ((re|
|00000e70| 73 75 6c 74 29 20 21 3d | 20 6e 6f 45 72 72 29 20 |sult) !=| noErr) |
|00000e80| 67 6f 74 6f 20 6c 61 62 | 65 6c 3b 0d 0d 70 61 73 |goto lab|el;..pas|
|00000e90| 63 61 6c 20 6c 6f 6e 67 | 20 41 45 54 68 72 65 61 |cal long| AEThrea|
|00000ea0| 64 28 41 45 54 68 72 65 | 61 64 50 61 72 61 6d 2a |d(AEThre|adParam*|
|00000eb0| 20 70 61 72 6d 73 29 0d | 7b 0d 09 41 70 70 6c 65 | parms).|{..Apple|
|00000ec0| 45 76 65 6e 74 09 09 65 | 76 65 6e 74 3b 09 09 09 |Event..e|vent;...|
|00000ed0| 2f 2f 20 4f 72 69 67 69 | 6e 61 6c 20 70 61 72 61 |// Origi|nal para|
|00000ee0| 6d 65 74 65 72 73 20 77 | 65 20 63 61 72 65 20 61 |meters w|e care a|
|00000ef0| 62 6f 75 74 0d 09 41 70 | 70 6c 65 45 76 65 6e 74 |bout..Ap|pleEvent|
|00000f00| 09 09 72 65 70 6c 79 3b | 0d 09 41 45 54 68 72 65 |..reply;|..AEThre|
|00000f10| 61 64 44 65 73 63 2a 09 | 64 65 73 63 3b 0d 09 4f |adDesc*.|desc;..O|
|00000f20| 53 45 72 72 09 09 09 65 | 72 72 3b 0d 09 4f 53 45 |SErr...e|rr;..OSE|
|00000f30| 72 72 09 09 09 70 72 6f | 63 45 72 72 3b 0d 09 41 |rr...pro|cErr;..A|
|00000f40| 45 53 77 61 70 44 61 74 | 61 09 09 73 77 61 70 3b |ESwapDat|a..swap;|
|00000f50| 0d 0d 09 65 76 65 6e 74 | 20 3d 20 2a 70 61 72 6d |...event| = *parm|
|00000f60| 73 2d 3e 65 76 65 6e 74 | 3b 09 09 09 2f 2f 20 63 |s->event|;...// c|
|00000f70| 6f 70 79 20 74 68 65 73 | 65 20 69 6e 74 6f 20 6f |opy thes|e into o|
|00000f80| 75 72 20 6f 77 6e 20 73 | 74 61 63 6b 20 66 72 61 |ur own s|tack fra|
|00000f90| 6d 65 0d 09 72 65 70 6c | 79 20 3d 20 2a 70 61 72 |me..repl|y = *par|
|00000fa0| 6d 73 2d 3e 72 65 70 6c | 79 3b 0d 09 64 65 73 63 |ms->repl|y;..desc|
|00000fb0| 20 20 3d 20 20 70 61 72 | 6d 73 2d 3e 64 65 73 63 | = par|ms->desc|
|00000fc0| 3b 0d 0d 23 69 66 20 30 | 09 0d 09 6d 79 54 6f 70 |;..#if 0|...myTop|
|00000fd0| 48 61 6e 64 6c 65 72 20 | 3d 20 67 54 6f 70 48 61 |Handler |= gTopHa|
|00000fe0| 6e 64 6c 65 72 3b 09 09 | 2f 2f 20 53 61 76 65 20 |ndler;..|// Save |
|00000ff0| 67 6c 6f 62 61 6c 20 66 | 61 69 6c 75 72 65 20 68 |global f|ailure h|
|00001000| 61 6e 64 6c 65 72 0d 09 | 67 54 6f 70 48 61 6e 64 |andler..|gTopHand|
|00001010| 6c 65 72 20 20 3d 20 6e | 69 6c 3b 09 09 09 09 2f |ler = n|il;..../|
|00001020| 2f 20 64 6f 6e 27 74 20 | 6c 65 74 20 66 61 69 6c |/ don't |let fail|
|00001030| 75 72 65 73 20 70 72 6f | 70 61 67 61 74 65 20 6f |ures pro|pagate o|
|00001040| 75 74 73 69 64 65 0d 23 | 65 6e 64 69 66 0d 0d 09 |utside.#|endif...|
|00001050| 45 72 72 43 68 65 63 6b | 28 70 75 6e 74 2c 20 65 |ErrCheck|(punt, e|
|00001060| 72 72 20 3d 20 53 65 74 | 54 68 72 65 61 64 53 77 |rr = Set|ThreadSw|
|00001070| 69 74 63 68 65 72 28 6b | 43 75 72 72 65 6e 74 54 |itcher(k|CurrentT|
|00001080| 68 72 65 61 64 49 44 2c | 20 41 45 53 77 69 74 63 |hreadID,| AESwitc|
|00001090| 68 49 6e 48 61 6e 64 6c | 65 72 2c 20 20 26 73 77 |hInHandl|er, &sw|
|000010a0| 61 70 2c 20 74 72 75 65 | 29 29 3b 0d 09 45 72 72 |ap, true|));..Err|
|000010b0| 43 68 65 63 6b 28 70 75 | 6e 74 2c 20 65 72 72 20 |Check(pu|nt, err |
|000010c0| 3d 20 53 65 74 54 68 72 | 65 61 64 53 77 69 74 63 |= SetThr|eadSwitc|
|000010d0| 68 65 72 28 6b 43 75 72 | 72 65 6e 74 54 68 72 65 |her(kCur|rentThre|
|000010e0| 61 64 49 44 2c 20 41 45 | 53 77 69 74 63 68 4f 75 |adID, AE|SwitchOu|
|000010f0| 74 48 61 6e 64 6c 65 72 | 2c 20 26 73 77 61 70 2c |tHandler|, &swap,|
|00001100| 20 66 61 6c 73 65 29 29 | 3b 0d 09 45 72 72 43 68 | false))|;..ErrCh|
|00001110| 65 63 6b 28 70 75 6e 74 | 2c 20 65 72 72 20 3d 20 |eck(punt|, err = |
|00001120| 41 45 53 75 73 70 65 6e | 64 54 68 65 43 75 72 72 |AESuspen|dTheCurr|
|00001130| 65 6e 74 45 76 65 6e 74 | 28 26 65 76 65 6e 74 29 |entEvent|(&event)|
|00001140| 29 3b 0d 0d 09 70 61 72 | 6d 73 2d 3e 72 65 73 75 |);...par|ms->resu|
|00001150| 6c 74 20 3d 20 6e 6f 45 | 72 72 3b 09 09 2f 2f 20 |lt = noE|rr;..// |
|00001160| 4c 65 74 20 63 61 6c 6c | 65 72 20 6b 6e 6f 77 20 |Let call|er know |
|00001170| 77 65 27 72 65 20 72 65 | 61 64 79 0d 0d 09 2f 2f |we're re|ady...//|
|00001180| 20 41 74 20 74 68 69 73 | 20 70 6f 69 6e 74 2c 20 | At this| point, |
|00001190| 77 65 20 6e 65 65 64 20 | 74 6f 20 6c 65 74 20 6f |we need |to let o|
|000011a0| 75 72 20 63 61 6c 6c 65 | 72 20 72 65 74 75 72 6e |ur calle|r return|
|000011b0| 0d 0d 09 77 68 69 6c 65 | 20 28 64 65 73 63 2d 3e |...while| (desc->|
|000011c0| 68 6f 6c 64 65 72 20 21 | 3d 20 6b 4e 6f 54 68 72 |holder !|= kNoThr|
|000011d0| 65 61 64 49 44 29 0d 09 | 7b 0d 09 09 59 69 65 6c |eadID)..|{...Yiel|
|000011e0| 64 54 6f 54 68 72 65 61 | 64 28 64 65 73 63 2d 3e |dToThrea|d(desc->|
|000011f0| 68 6f 6c 64 65 72 29 3b | 0d 09 7d 0d 0d 09 2f 2f |holder);|..}...//|
|00001200| 20 57 65 20 61 72 65 20 | 6e 6f 77 20 6f 6e 20 6f | We are |now on o|
|00001210| 75 72 20 6f 77 6e 0d 09 | 0d 09 70 72 6f 63 45 72 |ur own..|..procEr|
|00001220| 72 20 3d 20 65 72 72 20 | 3d 20 43 61 6c 6c 41 45 |r = err |= CallAE|
|00001230| 45 76 65 6e 74 48 61 6e | 64 6c 65 72 50 72 6f 63 |EventHan|dlerProc|
|00001240| 28 64 65 73 63 2d 3e 68 | 61 6e 64 6c 65 72 2c 20 |(desc->h|andler, |
|00001250| 26 65 76 65 6e 74 2c 20 | 26 72 65 70 6c 79 2c 20 |&event, |&reply, |
|00001260| 64 65 73 63 2d 3e 72 65 | 66 63 6f 6e 29 3b 0d 0d |desc->re|fcon);..|
|00001270| 09 09 2f 2f 20 53 69 6e | 63 65 20 74 68 65 20 65 |..// Sin|ce the e|
|00001280| 76 65 6e 74 20 77 61 73 | 20 73 75 73 70 65 6e 64 |vent was| suspend|
|00001290| 65 64 2c 20 77 65 20 6e | 65 65 64 20 74 6f 20 73 |ed, we n|eed to s|
|000012a0| 74 75 66 66 20 74 68 65 | 20 65 72 72 6f 72 20 63 |tuff the| error c|
|000012b0| 6f 64 65 20 6f 75 72 73 | 65 6c 76 65 73 09 0d 09 |ode ours|elves...|
|000012c0| 09 2f 2f 20 6e 6f 74 65 | 20 74 68 61 74 20 74 68 |.// note| that th|
|000012d0| 65 72 65 27 73 20 6e 6f | 74 20 6d 75 63 68 20 77 |ere's no|t much w|
|000012e0| 65 20 63 61 6e 20 64 6f | 20 61 62 6f 75 74 20 72 |e can do| about r|
|000012f0| 65 70 6f 72 74 69 6e 67 | 20 65 72 72 6f 72 73 20 |eporting| errors |
|00001300| 62 65 79 6f 6e 64 20 68 | 65 72 65 0d 09 09 0d 09 |beyond h|ere.....|
|00001310| 65 72 72 20 3d 20 41 45 | 50 75 74 41 74 74 72 69 |err = AE|PutAttri|
|00001320| 62 75 74 65 50 74 72 28 | 26 72 65 70 6c 79 2c 20 |butePtr(|&reply, |
|00001330| 6b 65 79 45 72 72 6f 72 | 4e 75 6d 62 65 72 2c 20 |keyError|Number, |
|00001340| 74 79 70 65 53 68 6f 72 | 74 49 6e 74 65 67 65 72 |typeShor|tInteger|
|00001350| 2c 20 26 70 72 6f 63 45 | 72 72 2c 20 73 69 7a 65 |, &procE|rr, size|
|00001360| 6f 66 28 70 72 6f 63 45 | 72 72 29 29 3b 0d 0d 23 |of(procE|rr));..#|
|00001370| 69 66 20 71 44 65 62 75 | 67 0d 09 69 66 20 28 65 |if qDebu|g..if (e|
|00001380| 72 72 29 0d 09 09 50 72 | 6f 67 72 61 6d 42 72 65 |rr)...Pr|ogramBre|
|00001390| 61 6b 28 22 5c 70 41 45 | 50 75 74 41 74 74 72 69 |ak("\pAE|PutAttri|
|000013a0| 62 75 74 65 50 74 72 20 | 66 61 69 6c 65 64 20 69 |butePtr |failed i|
|000013b0| 6e 73 74 61 6c 6c 69 6e | 67 20 65 72 72 6f 72 20 |nstallin|g error |
|000013c0| 63 6f 64 65 20 2d 20 76 | 65 72 79 20 62 61 64 22 |code - v|ery bad"|
|000013d0| 29 3b 0d 23 65 6e 64 69 | 66 0d 0d 09 65 72 72 20 |);.#endi|f...err |
|000013e0| 3d 20 41 45 52 65 73 75 | 6d 65 54 68 65 43 75 72 |= AEResu|meTheCur|
|000013f0| 72 65 6e 74 45 76 65 6e | 74 28 26 65 76 65 6e 74 |rentEven|t(&event|
|00001400| 2c 20 26 72 65 70 6c 79 | 2c 20 6b 41 45 4e 6f 44 |, &reply|, kAENoD|
|00001410| 69 73 70 61 74 63 68 2c | 20 30 29 3b 09 2f 2f 20 |ispatch,| 0);.// |
|00001420| 54 68 69 73 20 68 61 64 | 20 62 65 74 74 65 72 20 |This had| better |
|00001430| 77 6f 72 6b 0d 0d 23 69 | 66 20 71 44 65 62 75 67 |work..#i|f qDebug|
|00001440| 0d 09 69 66 20 28 65 72 | 72 29 0d 09 09 44 65 62 |..if (er|r)...Deb|
|00001450| 75 67 53 74 72 28 22 5c | 70 41 45 52 65 73 75 6d |ugStr("\|pAEResum|
|00001460| 65 54 68 65 43 75 72 72 | 65 6e 74 45 76 65 6e 74 |eTheCurr|entEvent|
|00001470| 20 66 61 69 6c 65 64 20 | 2d 20 76 65 72 79 20 62 | failed |- very b|
|00001480| 61 64 22 29 3b 0d 23 65 | 6e 64 69 66 0d 0d 23 69 |ad");.#e|ndif..#i|
|00001490| 66 20 30 0d 09 67 54 6f | 70 48 61 6e 64 6c 65 72 |f 0..gTo|pHandler|
|000014a0| 09 20 3d 20 6d 79 54 6f | 70 48 61 6e 64 6c 65 72 |. = myTo|pHandler|
|000014b0| 3b 09 2f 2f 20 52 65 73 | 74 6f 72 65 20 67 6c 6f |;.// Res|tore glo|
|000014c0| 62 61 6c 20 66 61 69 6c | 75 72 65 20 68 61 6e 64 |bal fail|ure hand|
|000014d0| 6c 65 72 0d 09 6d 79 54 | 6f 70 48 61 6e 64 6c 65 |ler..myT|opHandle|
|000014e0| 72 20 3d 20 6e 69 6c 3b | 09 09 09 09 2f 2f 20 4b |r = nil;|....// K|
|000014f0| 65 65 70 20 74 65 72 6d | 69 6e 61 74 6f 72 20 66 |eep term|inator f|
|00001500| 72 6f 6d 20 66 69 72 69 | 6e 67 20 68 61 6e 64 6c |rom firi|ng handl|
|00001510| 65 72 73 0d 23 65 6e 64 | 69 66 0d 0d 70 75 6e 74 |ers.#end|if..punt|
|00001520| 3a 0d 09 70 61 72 6d 73 | 2d 3e 72 65 73 75 6c 74 |:..parms|->result|
|00001530| 20 3d 20 65 72 72 3b 0d | 09 72 65 74 75 72 6e 20 | = err;.|.return |
|00001540| 6e 69 6c 3b 0d 7d 0d 0d | 23 70 72 61 67 6d 61 20 |nil;.}..|#pragma |
|00001550| 73 65 67 6d 65 6e 74 20 | 53 70 61 77 6e 0d 0d 70 |segment |Spawn..p|
|00001560| 61 73 63 61 6c 20 4f 53 | 45 72 72 20 41 45 53 70 |ascal OS|Err AESp|
|00001570| 61 77 6e 41 45 54 68 72 | 65 61 64 28 63 6f 6e 73 |awnAEThr|ead(cons|
|00001580| 74 20 41 70 70 6c 65 45 | 76 65 6e 74 20 2a 65 76 |t AppleE|vent *ev|
|00001590| 65 6e 74 2c 20 41 70 70 | 6c 65 45 76 65 6e 74 20 |ent, App|leEvent |
|000015a0| 2a 72 65 70 6c 79 2c 20 | 6c 6f 6e 67 20 68 61 6e |*reply, |long han|
|000015b0| 64 6c 65 72 52 65 66 63 | 6f 6e 29 0d 7b 0d 09 41 |dlerRefc|on).{..A|
|000015c0| 45 54 68 72 65 61 64 50 | 61 72 61 6d 20 70 61 72 |EThreadP|aram par|
|000015d0| 61 6d 3b 0d 09 0d 09 70 | 61 72 61 6d 2e 65 76 65 |am;....p|aram.eve|
|000015e0| 6e 74 20 20 3d 20 65 76 | 65 6e 74 3b 0d 09 70 61 |nt = ev|ent;..pa|
|000015f0| 72 61 6d 2e 72 65 70 6c | 79 20 20 3d 20 72 65 70 |ram.repl|y = rep|
|00001600| 6c 79 3b 0d 09 70 61 72 | 61 6d 2e 64 65 73 63 09 |ly;..par|am.desc.|
|00001610| 20 3d 20 28 41 45 54 68 | 72 65 61 64 44 65 73 63 | = (AETh|readDesc|
|00001620| 2a 29 20 68 61 6e 64 6c | 65 72 52 65 66 63 6f 6e |*) handl|erRefcon|
|00001630| 3b 0d 09 70 61 72 61 6d | 2e 74 68 72 65 61 64 20 |;..param|.thread |
|00001640| 3d 20 6b 4e 6f 54 68 72 | 65 61 64 49 44 3b 0d 0d |= kNoThr|eadID;..|
|00001650| 09 69 66 20 28 21 70 61 | 72 61 6d 2e 64 65 73 63 |.if (!pa|ram.desc|
|00001660| 29 0d 09 7b 0d 09 09 70 | 61 72 61 6d 2e 72 65 73 |)..{...p|aram.res|
|00001670| 75 6c 74 20 3d 20 70 61 | 72 61 6d 45 72 72 3b 0d |ult = pa|ramErr;.|
|00001680| 09 7d 0d 09 65 6c 73 65 | 0d 09 7b 0d 09 09 2f 2f |.}..else|..{...//|
|00001690| 20 6d 61 6b 65 20 73 75 | 72 65 20 6e 6f 2d 6f 6e | make su|re no-on|
|000016a0| 65 20 65 6c 73 65 20 69 | 73 20 74 72 79 69 6e 67 |e else i|s trying|
|000016b0| 20 74 6f 20 73 74 61 72 | 74 20 61 20 68 61 6e 64 | to star|t a hand|
|000016c0| 6c 65 72 0d 09 0d 09 09 | 77 68 69 6c 65 20 28 70 |ler.....|while (p|
|000016d0| 61 72 61 6d 2e 64 65 73 | 63 2d 3e 68 6f 6c 64 65 |aram.des|c->holde|
|000016e0| 72 20 21 3d 20 6b 4e 6f | 54 68 72 65 61 64 49 44 |r != kNo|ThreadID|
|000016f0| 29 0d 09 09 7b 0d 09 09 | 09 59 69 65 6c 64 54 6f |)...{...|.YieldTo|
|00001700| 41 6e 79 54 68 72 65 61 | 64 28 29 3b 0d 09 09 7d |AnyThrea|d();...}|
|00001710| 0d 09 09 0d 09 09 2f 2f | 20 47 72 61 62 20 74 68 |......//| Grab th|
|00001720| 65 20 73 65 6d 61 70 68 | 6f 72 65 0d 09 09 09 0d |e semaph|ore.....|
|00001730| 09 09 69 66 20 28 28 70 | 61 72 61 6d 2e 72 65 73 |..if ((p|aram.res|
|00001740| 75 6c 74 20 3d 20 47 65 | 74 43 75 72 72 65 6e 74 |ult = Ge|tCurrent|
|00001750| 54 68 72 65 61 64 28 26 | 70 61 72 61 6d 2e 64 65 |Thread(&|param.de|
|00001760| 73 63 2d 3e 68 6f 6c 64 | 65 72 29 29 20 3d 3d 20 |sc->hold|er)) == |
|00001770| 6e 6f 45 72 72 29 0d 09 | 09 7b 0d 09 09 09 70 61 |noErr)..|.{....pa|
|00001780| 72 61 6d 2e 72 65 73 75 | 6c 74 20 3d 20 4e 65 77 |ram.resu|lt = New|
|00001790| 54 68 72 65 61 64 28 6b | 43 6f 6f 70 65 72 61 74 |Thread(k|Cooperat|
|000017a0| 69 76 65 54 68 72 65 61 | 64 2c 0d 09 09 09 09 09 |iveThrea|d,......|
|000017b0| 09 09 28 54 68 72 65 61 | 64 45 6e 74 72 79 50 72 |..(Threa|dEntryPr|
|000017c0| 6f 63 50 74 72 29 20 26 | 41 45 54 68 72 65 61 64 |ocPtr) &|AEThread|
|000017d0| 2c 0d 09 09 09 09 09 09 | 09 26 70 61 72 61 6d 2c |,.......|.¶m,|
|000017e0| 0d 09 09 09 09 09 09 09 | 70 61 72 61 6d 2e 64 65 |........|param.de|
|000017f0| 73 63 2d 3e 73 74 61 63 | 6b 53 69 7a 65 2c 0d 09 |sc->stac|kSize,..|
|00001800| 09 09 09 09 09 09 70 61 | 72 61 6d 2e 64 65 73 63 |......pa|ram.desc|
|00001810| 2d 3e 6f 70 74 69 6f 6e | 73 2c 0d 09 09 09 09 09 |->option|s,......|
|00001820| 09 09 6e 69 6c 2c 0d 09 | 09 09 09 09 09 09 26 70 |..nil,..|......&p|
|00001830| 61 72 61 6d 2e 74 68 72 | 65 61 64 29 3b 0d 09 09 |aram.thr|ead);...|
|00001840| 09 0d 09 09 09 69 66 20 | 28 70 61 72 61 6d 2e 72 |.....if |(param.r|
|00001850| 65 73 75 6c 74 20 3d 3d | 20 6e 6f 45 72 72 29 0d |esult ==| noErr).|
|00001860| 09 09 09 7b 0d 09 09 09 | 09 70 61 72 61 6d 2e 72 |...{....|.param.r|
|00001870| 65 73 75 6c 74 20 3d 20 | 31 3b 0d 09 09 09 0d 09 |esult = |1;......|
|00001880| 09 09 09 64 6f 0d 09 09 | 09 09 7b 0d 09 09 09 09 |...do...|..{.....|
|00001890| 09 59 69 65 6c 64 54 6f | 54 68 72 65 61 64 28 70 |.YieldTo|Thread(p|
|000018a0| 61 72 61 6d 2e 74 68 72 | 65 61 64 29 3b 0d 09 09 |aram.thr|ead);...|
|000018b0| 09 09 7d 0d 09 09 09 09 | 77 68 69 6c 65 20 28 70 |..}.....|while (p|
|000018c0| 61 72 61 6d 2e 72 65 73 | 75 6c 74 20 3d 3d 20 31 |aram.res|ult == 1|
|000018d0| 29 3b 09 2f 2f 20 57 61 | 69 74 20 66 6f 72 20 74 |);.// Wa|it for t|
|000018e0| 68 72 65 61 64 20 74 6f | 20 70 69 63 6b 20 75 70 |hread to| pick up|
|000018f0| 20 70 61 72 61 6d 65 74 | 65 72 73 0d 09 09 09 7d | paramet|ers....}|
|00001900| 0d 09 09 7d 0d 09 09 0d | 09 09 70 61 72 61 6d 2e |...}....|..param.|
|00001910| 64 65 73 63 2d 3e 68 6f | 6c 64 65 72 20 3d 20 6b |desc->ho|lder = k|
|00001920| 4e 6f 54 68 72 65 61 64 | 49 44 3b 09 2f 2f 20 72 |NoThread|ID;.// r|
|00001930| 65 6c 65 61 73 65 20 61 | 6e 79 20 63 6c 61 69 6d |elease a|ny claim|
|00001940| 73 20 77 65 20 68 61 76 | 65 0d 09 7d 0d 09 0d 09 |s we hav|e..}....|
|00001950| 72 65 74 75 72 6e 20 70 | 61 72 61 6d 2e 72 65 73 |return p|aram.res|
|00001960| 75 6c 74 3b 0d 7d 0d 0d | 0d 0d 0d 00 00 00 00 00 |ult;.}..|........|
|00001970| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001980| 00 00 01 00 00 00 01 54 | 00 00 00 54 00 00 00 46 |.......T|...T...F|
|00001990| 01 00 00 46 ff ff 00 00 | 0f 9e 0d 53 79 73 74 65 |...F....|...Syste|
|000019a0| 6d 20 46 6f 6c 64 65 72 | 65 73 72 69 70 74 73 29 |m Folder|esripts)|
|000019b0| 0b 41 45 54 68 72 65 61 | 64 73 2e 63 02 00 00 00 |.AEThrea|ds.c....|
|000019c0| 54 45 58 54 4d 4d 43 43 | 01 00 ff ff ff ff 00 00 |TEXTMMCC|........|
|000019d0| 00 00 54 45 58 54 4d 4d | 43 43 01 00 ff ff ff ff |..TEXTMM|CC......|
|000019e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000019f0| 00 00 ab 53 07 5f 00 00 | 18 eb 00 00 01 9a 00 00 |...S._..|........|
|00001a00| 00 00 60 00 07 50 ff 00 | 01 54 49 04 01 00 00 46 |..`..P..|.TI....F|
|00001a10| ff ff 00 00 10 ff 11 50 | 6f 77 65 72 53 65 63 72 |.......P|owerSecr|
|00001a20| 65 74 61 72 79 aa 20 c4 | 20 32 2e 30 61 33 20 c4 |etary. .| 2.0a3 .|
|00001a30| 61 72 79 40 54 30 00 00 | 00 00 00 00 00 00 00 00 |ary@T0..|........|
|00001a40| 60 00 0d 50 ff 00 01 54 | 49 04 01 00 00 3b 00 00 |`..P...T|I....;..|
|00001a50| 00 00 03 6d 05 49 6e 42 | 6f 78 6e 67 73 73 73 a8 |...m.InB|oxngsss.|
|00001a60| 20 43 6c 69 65 6e 74 20 | 32 2e 35 30 35 73 68 73 | Client |2.505shs|
|00001a70| 29 40 54 30 00 00 00 00 | 00 00 00 00 00 00 80 00 |)@T0....|........|
|00001a80| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00001a90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001aa0| 00 00 00 00 00 00 00 03 | 00 04 00 6c 01 3a 03 18 |........|...l.:..|
|00001ab0| 03 a6 00 6c 01 3a 03 18 | 03 a6 ab b5 c0 a3 00 00 |...l.:..|........|
|00001ac0| 15 56 00 00 15 56 00 00 | 14 c5 01 00 00 00 00 04 |.V...V..|........|
|00001ad0| 00 01 00 01 00 00 01 00 | 00 00 01 54 00 00 00 54 |........|...T...T|
|00001ae0| 00 00 00 46 02 10 69 e8 | 18 3e 00 00 00 1c 00 46 |...F..i.|.>.....F|
|00001af0| 00 01 4d 50 53 52 00 00 | 00 12 4d 57 42 42 00 00 |..MPSR..|..MWBB..|
|00001b00| 00 1e 03 ed ff ff 00 00 | 00 00 00 00 00 00 03 f0 |........|........|
|00001b10| ff ff 00 00 00 4c 00 00 | 00 00 00 00 00 00 00 00 |.....L..|........|
|00001b20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+